import socket
import subprocess

domain = 'xiaomi.cn'

p = subprocess.Popen(['whosip', domain], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
(output, err) = p.communicate()
result = {}
for i in output.decode().splitlines():
    i = i.strip()
    if not i:
        continue
    k, v = i.split(':')
    result[k.strip()] = v.strip()

print(result)
